package alo.p6.work3;

import alo.p6.ThreadedBinaryTreeNode;

/**
 * @ClassName InOrderTraversal
 * @Description 中序线索二叉树的中序遍历
 * @Author Fanxc
 * @DATE 2021/2/6 11:18
 * @Version 1.0
 */
public class InorderTraversal {
    //调用方法，利用后继
    void inorderTraversal(ThreadedBinaryTreeNode root){
        InorderSuccessor inOrderSuccessor = new InorderSuccessor();
        ThreadedBinaryTreeNode P = inOrderSuccessor.inorderSuccessor(root);
        while (P!=root){
            P=inOrderSuccessor.inorderSuccessor(P);
            System.out.println(P.getData());
        }
    }
}
